home *** CD-ROM | disk | FTP | other *** search
- Path: nntp.teleport.com!usenet
- From: GHouck <hksys@teleport.com>
- Newsgroups: comp.lang.c
- Subject: Re: Nee help with a string and temp string
- Date: 13 Apr 1996 07:08:08 GMT
- Organization: systems hk
- Message-ID: <4knjso$i9s@nadine.teleport.com>
- References: <316C72CC.763A@cloudnet.com>
- NNTP-Posting-Host: ip-pdx14-40.teleport.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.22 (Windows; I; 32bit)
-
- "Randall J. Pfeifer" <rpfeifer@cloudnet.com> wrote:
- [snip]
- >As each component is evaluated the result is concatenad to a buffer string, with the
- >first component that is evaulated being copied instead of concatenaded.
- >Once the whole line is evaulated and corrected if necessary, I write that line to a file.
- >
- >I then read another line and start the process over again.
- >
- >My problem involves lines 2 through X.
- > Reading the data is fine. However, when I evaluate the components and write them to the
- > buffer the previous lines data still resides in the string.
- >
- >How can I get rid of the old lines data in my temp string.
- [snip]
- Randall,
- Based upon your question and not the code, I would suggest the following:
-
- 1. init buffer ( e.g.: *buffer = NULL;)
- 2 read( firststring );
- 3 process( firststring );
- 4 strcat( buffer,firststring );
- 5 read( secondstring );
- 6 process( secondstring );
- 7 strcat( buffer,secondstring );
- 8 write( buffer );
- 9 repeat 1-8, until run out of data
-
- Yours, Geoff Houck
-
-